#include<stdio.h>
#include <string.h>
void fun(char *s)
{
	int n;
 	char *p;
	n=strlen(s);
 	if(n>0)
 	{
/***found***/
	 	p=s+n-1;
	 	while(*p==' ')
/***found***/
			p--;
/***found***/
		*(p+1)='\0';
	}
 } 
int main()
{ 
	char s[100];
	gets(s);
	fun(s);
	printf("%s#\n",s);
	return 0;
}

